/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// package com.android.internal.widget;
package com.rchik.divermate;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class NumberDisplayer extends LinearLayout {

    private TextView mText;
    private ImageView topImage;
    private ImageView bottomImage;
    
    public NumberDisplayer(Context context) {
        this(context, null);
    }

    public NumberDisplayer(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public NumberDisplayer(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs);
        setOrientation(VERTICAL);
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.numberdisplayer, this, true);
        
        if (!isEnabled()) {
            setEnabled(false);
        }
    }

    public void Initialize()
    {
        mText = (TextView) findViewById(R.id.timepicker_input);
        
        topImage = (ImageView)findViewById(R.id.TopImageView);
        
        bottomImage = (ImageView)findViewById(R.id.TagImageView);
    }
    
    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        mText.setEnabled(enabled);
    }

    public void setText( CharSequence text)
    {
    	mText.setText(text);
    }
    
    public void setText( int resId )
    {
    	mText.setText(resId);
    }
    
    public CharSequence getText()
    {
    	return mText.getText();
    }
    
    public void setTopImage( int resId )
    {
    	topImage.setImageResource(resId);
    }
    
    public void setBottomImage( int resId )
    {
    	bottomImage.setImageResource(resId);
    }
}